package myapps.ttclient.connection;

import java.io.IOException;
import java.io.Serializable;

import myapps.ttclient.app.TTClientApplication;
import myapps.ttclient.baseclass_and_interface.TTClientConnection;



import android.content.Context;
import android.content.SharedPreferences.Editor;

public abstract class Connection implements Comparable<Connection>, Serializable
{


	
	public static final int NONE = -1;
	public static final int WIFI = 0;
	public static final int BLUETOOTH = 1;

	protected String name;

	public Connection()
	{
		this.name = "";
	}

	public abstract TTClientConnection connect(TTClientApplication application) throws IOException;

	public abstract void save(Editor editor, int position);

	public abstract void edit(Context context);

	public int compareTo(Connection c)
	{
		return this.name.compareTo(c.name);
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}
}
